package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.mall.lib.domain.enumclass.CustomerProductOrderStatus;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * Created by DK on 16/10/28.
 */
@Entity
@Table(name = "customer_product_order")
@DynamicInsert
@DynamicUpdate
public class CustomerProductOrder extends IDEntityMall{

    @Column(columnDefinition = "varchar(100) comment '订单号'")
    private String merchantOrderNum;

    @Column(columnDefinition = "bigint comment '客户ID'")
    private Long customerId;

    @Column(columnDefinition = "varchar(30) comment '兑换码'")
    private String verifyCode;

    @Column(columnDefinition = "text comment '二维码路径'")
    private String qrcCodeUrl;

    @Column(columnDefinition = "varchar(255) comment '核销码唯一标志'")
    private String verifyKey;

    @Column(columnDefinition = "bigint comment '商家id'")
    private Long merchantId;

    @Column(columnDefinition = "bigint comment '平台id'")
    private Long mallId;

    @Column(columnDefinition = "varchar(30) comment '状态 TO_USE(\"待使用\"), USED(\"已使用\"))'")
    @Enumerated(EnumType.STRING)
    private CustomerProductOrderStatus status;

    @Column(columnDefinition = "bigint comment '使用数量'")
    private Long useNum;

    @Column(columnDefinition = "bigint comment '产品订单ID'")
    private Long merchantOrderItemId;

    public String getMerchantOrderNum() {
        return merchantOrderNum;
    }

    public void setMerchantOrderNum(String merchantOrderNum) {
        this.merchantOrderNum = merchantOrderNum;
    }

    public Long getCustomerId() {
        return customerId;
    }

    public void setCustomerId(Long customerId) {
        this.customerId = customerId;
    }

    public String getVerifyCode() {
        return verifyCode;
    }

    public void setVerifyCode(String verifyCode) {
        this.verifyCode = verifyCode;
    }

    public String getQrcCodeUrl() {
        return qrcCodeUrl;
    }

    public void setQrcCodeUrl(String qrcCodeUrl) {
        this.qrcCodeUrl = qrcCodeUrl;
    }

    public String getVerifyKey() {
        return verifyKey;
    }

    public void setVerifyKey(String verifyKey) {
        this.verifyKey = verifyKey;
    }

    public Long getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(Long merchantId) {
        this.merchantId = merchantId;
    }

    public Long getMallId() {
        return mallId;
    }

    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }

    public CustomerProductOrderStatus getStatus() {
        return status;
    }

    public void setStatus(CustomerProductOrderStatus status) {
        this.status = status;
    }

    public Long getUseNum() {
        return useNum;
    }

    public void setUseNum(Long useNum) {
        this.useNum = useNum;
    }

    public Long getMerchantOrderItemId() {
        return merchantOrderItemId;
    }

    public void setMerchantOrderItemId(Long merchantOrderItemId) {
        this.merchantOrderItemId = merchantOrderItemId;
    }

    @Override
    public String toString() {
        return "CustomerProductOrder{" +
                "merchantOrderNum='" + merchantOrderNum + '\'' +
                ", id=" + id +
                ", customerId=" + customerId +
                ", verifyCode='" + verifyCode + '\'' +
                ", dateCreated=" + dateCreated +
                ", qrcCodeUrl='" + qrcCodeUrl + '\'' +
                ", lastUpdated=" + lastUpdated +
                ", verifyKey='" + verifyKey + '\'' +
                ", merchantId=" + merchantId +
                ", isDelete=" + isDelete +
                ", mallId=" + mallId +
                ", version=" + version +
                ", status=" + status +
                ", useNum=" + useNum +
                ", merchantOrderItemId=" + merchantOrderItemId +
                '}';
    }
}
